<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate30 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('box_skus', function (Blueprint $table) {
            $table->float('probability_percent')->nullable()->comment('抽中概率 (百分比)');
            $table->integer('money_price')->nullable()->comment('人民币原价');
            $table->integer('score_price')->nullable()->comment('积分原价');

            $table->integer('last_sales_index')->default(0)->comment('最后一次抽出的位置(在总次数中排序的数字)');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('box_skus', function (Blueprint $table) {
            $table->dropColumn('probability_percent');
            $table->dropColumn('money_price');
            $table->dropColumn('score_price');
            $table->dropColumn('last_sales_index');
        });
    }
}
